package com.lakeworks.service.impl;

import com.lakeworks.domain.status.PostPack;
import com.lakeworks.mapper.PostPackMapper;
import com.lakeworks.service.IPostPackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 打包记录Service业务层处理
 *
 * @author lake
 * @date 2023-02-23
 */
@Service
public class PostPackServiceImpl implements IPostPackService {
    @Autowired
    private PostPackMapper postPackMapper;

    /**
     * 查询打包记录
     *
     * @param id 打包记录主键
     * @return 打包记录
     */
    @Override
    public PostPack selectPostPackById(Long id) {
        return postPackMapper.selectPostPackById(id);
    }

    /**
     * 查询打包记录列表
     *
     * @param postPack 打包记录
     * @return 打包记录
     */
    @Override
    public List<PostPack> selectPostPackList(PostPack postPack) {
        return postPackMapper.selectPostPackList(postPack);
    }

    /**
     * 新增打包记录
     *
     * @param postPack 打包记录
     * @return 结果
     */
    @Override
    public int insertPostPack(PostPack postPack) {
        return postPackMapper.insertPostPack(postPack);
    }

    /**
     * 修改打包记录
     *
     * @param postPack 打包记录
     * @return 结果
     */
    @Override
    public int updatePostPack(PostPack postPack) {
        return postPackMapper.updatePostPack(postPack);
    }

    /**
     * 批量删除打包记录
     *
     * @param ids 需要删除的打包记录主键
     * @return 结果
     */
    @Override
    public int deletePostPackByIds(Long[] ids) {
        return postPackMapper.deletePostPackByIds(ids);
    }

    @Override
    public int deletePostPackByProductId(Long productId) {
        return postPackMapper.deletePostPackByProductId(productId);
    }
}
